package com.cn.hnust.controller;



import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.hnust.entity.HtStaffType;
import com.cn.hnust.service.LoginService;


@Controller
public class loginController {
	
	@Autowired
	private LoginService loginService;
	
	/**
	 * 访问首页
	 * @param request
	 * @return
	 */
	@RequestMapping(value="/login" , method = RequestMethod.GET)
	public String loginGet(HttpServletRequest request){
	
		return "/login";
	}
	
	@RequestMapping(value="/login1" /*method = RequestMethod.POST*/)
	public String loginPost(HttpServletRequest request){
		
		String username = request.getParameter("username");
		String password = request.getParameter("password");
		
		System.out.println("用户姓名："+username +"{}"+ "登录密码" + password);
		List<HtStaffType> list = loginService.queryStaffType();
		System.out.println(list);
		return "/home/homeSchool";
	}


}
